interface Swim {
    swimming: () => void
}

interface IEct {
    eat: () => void
}

class Animal {
     
}

// 实现多个接口
class Fish extends Animal implements Swim, IEct {
    swimming() {
        console.log('swimming')
    }
    eat() {
        console.log('eat')
    }
}

// 编写公共api变得灵活、

function fatchOrder( o: Swim) {
    o.swimming()
}

// 所有实现了接口的类型对象都可以使用
fatchOrder(new Fish())

fatchOrder({swimming() {}})